<?php
namespace   app\admin\validate;
use think\Validate;
class Links extends Validate{
    protected $rule =[
            'title' => 'require|max:25',
            'url' => 'require|url',
    ];

    protected $message =[
        'title.require' => '链接标题不能为空',
        'title.max' => '链接标题长度不得大于25',
        'url.require' => '链接地址必须填写'
    ];

    protected $scene=[
        'add'=>['title','url'],
        'edit'=>['title','url']
    ];
}